﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="OrderDetail.aspx.cs" Inherits="Manager_Revenue_OrderDetail" %>

<%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <link href="../../Pub/Css/BodyStyles.css" rel="stylesheet" type="text/css" />
    <link href="../../Pub/Css/AdminStyles.css" rel="stylesheet" type="text/css" />
    <link href="../../Pub/Css/CalendarStyles.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" language="javascript">
      function Picker1_onSelectionChanged(sender, eventArgs)
      {
        cldStart.SetSelectedDate(Picker1.GetSelectedDate());   
        cldStart.Show();
      }
      function cldStart_onSelectionChanged(sender, eventArgs)
      {
      
            var fromDate = cldStart.GetSelectedDate();
            var toDate = cldEnd.GetSelectedDate();
            Picker1.SetSelectedDate(fromDate);            
           /* if(fromDate > toDate)
            {
              Picker2.SetSelectedDate(fromDate);
              cldEnd.SetSelectedDate(fromDate);
            }  */             
      }
      
      function Picker2_onSelectionChanged(sender, eventArgs)
      {
        cldEnd.SetSelectedDate(Picker2.GetSelectedDate());
        cldEnd.Show();
      }
      function cldEnd_onSelectionChanged(sender, eventArgs)
      {         
            var fromDate = cldStart.GetSelectedDate();
            var toDate = cldEnd.GetSelectedDate();
            Picker2.SetSelectedDate(toDate);            
           /* if(fromDate > toDate)
            {
              Picker1.SetSelectedDate(toDate);
              cldStart.SetSelectedDate(toDate);
            }         */           
      }
    //]]>
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div>
            <table border="0" -="0" cellspacing="0" style="width: 100%">
                <tr>
                    <td nowrap="nowrap" style="height: 3px">
                        <table bgcolor="#f7ffe4" border="1" bordercolor="#407db3" cellpadding="2" cellspacing="0"
                            style="width: 100%; border-collapse: collapse">
                            <tr>
                                <td runat="server" align="center" nowrap="nowrap" rowspan="1" style="width: 74px">
                                    <asp:Button ID="btnSearch" runat="server" CssClass="cssButton" OnClick="btnSearch_Click"
                                        Text="Tìm kiếm" Width="81px" /></td>
                                <td class="td_Title" nowrap="nowrap" style="width: 101px">
                                    <asp:Label ID="Label2" runat="server" Text="Tên khách hàng:"></asp:Label></td>
                                <td nowrap="nowrap">
                                    <asp:TextBox ID="txtCusNm" runat="server" CssClass="txt_Product" Width="90%"></asp:TextBox></td>
                                <td class="td_Title" nowrap="nowrap" style="width: 91px">
                                    <asp:Label ID="Label1" runat="server" Text="Đơn đặt hàng:"></asp:Label></td>
                                <td nowrap="nowrap" style="width: 20%">
                                    &nbsp;
                                    <asp:TextBox ID="txtDDH" runat="server" CssClass="txt_Product" Width="150px"></asp:TextBox></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td align="right" style="height: 2px">
                    </td>
                </tr>
                <tr>
                    <td colspan="1" nowrap="nowrap">
                        <asp:GridView ID="grvMaster" runat="server" AutoGenerateColumns="False" CellPadding="2"
                            BorderWidth="1px" Width="100%" OnRowDataBound="grvMaster_RowDataBound" DataKeyNames="OrderID"
                            BorderColor="#407db3" OnPageIndexChanging="grvMaster_PageIndexChanging" PageSize="20" ShowFooter="True">
                            <Columns>
                                <asp:TemplateField>
                                    <HeaderTemplate>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                    </ItemTemplate>
                                    <ItemStyle CssClass="cssBorderGrv" Width="1%" HorizontalAlign="Center" />
                                    <HeaderStyle CssClass="cssBorderGrv" Width="1%" />
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <HeaderTemplate>
                                        Mã đơn hàng</HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="hplOrderID" runat="server" Text='<%# Eval("OrderID") %>' Font-Bold="true"
                                            ForeColor="green"></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle Wrap="False" Width="1%" HorizontalAlign="Center" CssClass="cssBorderGrv" />
                                    <HeaderStyle CssClass="cssBorderGrv" Wrap="False" />
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <HeaderTemplate>
                                        T&#234;n Kh&#225;ch H&#224;ng</HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="hplHoten" runat="server" Text='<%# Eval("CusNm") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle CssClass="cssBorderGrv" Wrap="False" />
                                    <HeaderStyle CssClass="cssBorderGrv" Width="40%" />
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <HeaderTemplate>
                                        Số lượng
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                    </ItemTemplate>
                                    <ItemStyle CssClass="cssBorderGrv" Wrap="False" HorizontalAlign="Center" />
                                   <HeaderStyle CssClass="cssBorderGrv" Wrap="False" Width="1%"/> 
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <HeaderTemplate>
                                        Tổng tiền(VNĐ)
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                    </ItemTemplate>
                                    <ItemStyle CssClass="cssBorderGrv" Wrap="False" HorizontalAlign="Right" />
                                   <HeaderStyle CssClass="cssBorderGrv" Wrap="False" /> 
                                </asp:TemplateField>                               
                            </Columns>
                            <RowStyle CssClass="gvRowStyle" Height="10px" />
                            <FooterStyle CssClass="gv_FooterBasket" BackColor="PaleTurquoise" />
                            <HeaderStyle CssClass="cssHeader" Height="20px" HorizontalAlign="Center" Wrap="False" />
                            <AlternatingRowStyle CssClass="gvAlternatingRowStyle" Height="10px" />
                            <EmptyDataTemplate>
                                <asp:Label ID="lblEmpty" runat="server" Text="Chưa có đơn đặt hàng"></asp:Label>
                            </EmptyDataTemplate>
                            <EmptyDataRowStyle Font-Size="13px" ForeColor="Red" Font-Names="Tahoma" />
                        </asp:GridView>
                    </td>
                </tr>
               
                <tr>
                    <td nowrap="nowrap">
                        &nbsp;</td>
                </tr>
            </table>
            
        </div>
    </form>

    <script language="javascript" type="text/javascript">
    function fnPrintOrder(CodeID,OrderID,State)
    {
        var width=screen.availWidth-30;
        var height=screen.availHeight-20;
        var left = parseInt((screen.availWidth/2) - (width/2));
		var top = parseInt((screen.availHeight/2) - (height/2));
        //var feature="width="+width+",height="+height+",menu=0,scrollbars=1,status=1,location=0,resizable=1,left=" + left + ",top=20,screenX=" + left + ",screenY=" + top;
        var feature="menu=0,scrollbars=1,status=1,location=0,resizable=1,fullscreen=1";
       
        window.open("../OrderDetail/OrderDetailOK.aspx?CodeID=" + CodeID  + "&sOrderID=" +OrderID+ "&sState=" + State,"",feature)
    }
    </script>

</body>
</html>
